//CPU类
class CPU{
    public int speed;
    public void setSpeed(int Speed){
        speed=Speed;
        return;
    }
    public int getSpeed(){
        return speed;
    }
}
//HardDisk类
class HardDisk{
    public int amount;
    public void setAmount(int Amount){
        amount=Amount;
        return;
    }
    public int getAmount(){
        return amount;
    }
}
//PC类
class PC{
    CPU cpu;
    HardDisk HD;
    public void setCPU(CPU c){
        cpu=c;
        return;
    }
    public void setHardDisk(HardDisk c){
        HD=c;
        return;
    }
    public void show(){
        System.out.println("CPU Speed:"+cpu.getSpeed());
        System.out.println("HardDisk Amount:"+HD.getAmount());
    }
}
public class Test {
    public static void main(String[] args) {
        CPU cpu=new CPU();//创建CPU类对象
        HardDisk disk=new HardDisk();//创建HardDisk类对象
        cpu.setSpeed(200);//设置cpu的速度
        disk.setAmount(200);//设置硬盘的容量
        PC pc=new PC();//创建PC类对象
        pc.setCPU(cpu);//设置pc的cpu
        pc.setHardDisk(disk);//设置pc的硬盘
        pc.show();//显示pc的cpu速度和硬盘容量
    }
}
